package com.gxa.clientkill.service.Impl;

import com.gxa.clientkill.mapper.LuckMapper;
import com.gxa.clientkill.pojo.Luck;
import com.gxa.clientkill.service.LuckService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Jun
 * @version 1.0
 * @date 2020/11/12 9:35
 */

@Service("luckService")
public class LuckServiceImpl implements LuckService {

    @Resource
    LuckMapper luckMapper;

    @Override
    public Integer add(Luck luck) {
        return luckMapper.insertSelective(luck);
    }

    @Override
    public Integer del(Integer id) {
        return luckMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Luck> list() {
        return luckMapper.selectAll();
    }

    @Override
    public Integer send(Integer id) {
        return null;
    }

    @Override
    public Integer update(Luck luck) {
        return luckMapper.updateByPrimaryKeySelective(luck);
    }

    @Override
    public Integer rec(Luck luck) {
        return luckMapper.updateByPrimaryKeySelective(luck);
    }

    @Override
    public Luck sel(Integer id) {
        return luckMapper.selectByPrimaryKey(id);
    }
}
